package com.neuedu.corejava.ch9.practise;

import java.io.UnsupportedEncodingException;

public class TestStringCharset {

	public static void main(String[] args) {
		
		byte[] bname=new byte[10];
		String name1="张三";
		
		try {
			bname=name1.getBytes("UTF-8");
			String name2=new String(bname,"utf-8");
			System.out.println("name2="+name2);  //name2=张三
			
			for(int i=0;i<bname.length;i++) {
				System.out.println(bname[i]);
			}
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		
		
		

	}

}
